package shuaige.jdk.多线程.volatile关键字;

public class VolatileMain {
    public static void main(String[] args) throws InterruptedException {
        VolatileDemo t = new VolatileDemo();
        t.start();
        Thread.sleep(1);
        t.running = false; // 标志位置为false
    }
}
